﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SMTC.Dao.BaseInfo;
using System.Web.UI.WebControls;

namespace SMTC.WebCommon.Control
{
    public class PUVersionDropDownList : System.Web.UI.WebControls.DropDownList
    {
        private ProductionUnitProccessDao _dao = new ProductionUnitProccessDao();
        protected override void OnLoad(EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                List<string> list = _dao.GetPUVersion();
                List<ListItem> dateSourceList = new List<ListItem>();
                foreach (var item in list)
                {
                    dateSourceList.Add(new ListItem(item, item));
                }
                DataSource = dateSourceList;
                DataTextField = "Text";
                DataValueField = "Value";
                this.DataBind();
            }
            base.OnLoad(e);
        }
    }
}
